import axios from '@/utils/request'
/**
 * 获取所有部门数据
*/
export const getDepartmentData = () => {
  return axios({
    url: '/company/department'
  })
}
/**
 * 根据id删除部门详情
*/
export const delDepartment = (id) => {
  return axios({
    url: `/company/department/${id}`,
    method: 'DELETE'
  })
}
/**
 * 添加部门详情
*/
export const addDepartment = (data) => {
  return axios({
    url: '/company/department',
    method: 'post',
    data
  })
}
/**
 * 根据id获取部门详情
 */
export const getDepartmentById = (id) => {
  return axios({
    url: `/company/department/${id}`
  })
}
/**
 * 根据id编辑部门详情
 */
export const eidtDeparmentById = (data) => {
  return axios({
    url: `/company/department/${data.id}`,
    method: 'PUT',
    data
  })
}

